<!--20210304    zaq    创建vue文件，修改账簿-->
<!--20210510    zaq    设计界面-->
<!--20210520    zaq    与后端接口进行调试-->
<!--20210521    zaq    调试完成-->





<template>
<!--修改账簿内容-->
  <div>
    <el-form ref="form" :model="form" :rules="check" label-width="80px">
      <el-form-item label="账簿名称" prop="chekPlanet">
        <el-input v-model="form.bName"
                  maxlength="10"
                  show-word-limit
        ></el-input>
      </el-form-item><br>
      <span style="color: #8c939d">创建日期:{{Createdate}}</span>
    </el-form>

  </div>
</template>

<script>
export default {
  name: "Update_book",
  props:{
    form:{
      bId:-1,//账簿ID
      bName:"",//账簿名称
      bCreatedate:0,//创建时间
      bDefault:0,//默认账簿
      delete:0,
      uId:-1,
      bKind:-1,//账簿类型
      flagGroup:false,//有无组别
      bookUpdate:false,//账簿信息修改弹框
      selectDrawer: false,//查询收支信息drawer
    },
  },
  data(){


    // 合法性判断
    var validate = (rule, value, callback) => {
      //合法性判断
      if (!value) {
        return callback(new Error('账簿名称不能为空'));
      }
    };
    return{
      check:{
        checkPlanet:[
          {validator: validate, trigger: 'blur'}
        ]
      },
      Createdate:'123',
    }
  },
  methods:{
    getCreateDate(){
      var str=this.form.bCreatedate.toString()
      var yyyy=str.substr(0,4)
      var mm=str.substr(4,2)
      var dd=str.substr(6,2)
      var create=''+yyyy+'-'+mm+'-'+dd
      this.Createdate = create
    }
  },
  mounted() {
    this.getCreateDate()
  }
}
</script>

<style scoped>

</style>